|
|
|
|
|
|
|
As soon as you copy all the controls, you can start moving the code into the control. Again, you can start by copying the code from the form and modifying it. If you want, you can also create a property page for this control. |
|
|
|
|
|
|
|
|
Now that you've completed the conversion process, you can add the control to the Explorer interface. The only thing left to do is add the code to the Explorer menu and toolbar to resize the control, refresh the data control it contains, and then make it visible. The code in Listing 11.1 shows you what routine this should be placed in and how to perform the resizing. |
|
|
|
|
|
|
|
|
LISTING 11.1. ADDRRESIZE.TXTADDING THE ADDRGRID CONTROL'S PROCESSING CODE TO THE MAIN EXPLORER ROUTINES. |
|
|
|
 |
|
|
|
|
1: Case Data Grid
2: ctlDataGrid1.Left = 1vListView.Left
3: ctlDataGrid1.Width = lvListView.Width
4: ctlDataGrid1.Top = lvListView.Top
5: ctlDataGrid1.Height = lvListView.Height
6: ctlDataGrid1.Visible = True |
|
|
|
|
|
|
|
|
You should add this code to the toolbar Select Case statement so that the new control will be displayed when the grid button is clicked. If you've done everything correctly, the grid should be displayed when you choose View, Book List from the menu. What you would see is shown in Figure 11.17. |
|
|
|
|
|
|
|
|
Figure 11.17.
The new AddrGrid control as it's displayed in the
Address Book application. |
|
|
|
|
|